package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.InventoryWarningMapper;
import com.ruoyi.system.domain.InventoryWarning;
import com.ruoyi.system.service.IInventoryWarningService;
import com.ruoyi.common.core.text.Convert;

/**
 * 库存预警记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-16
 */
@Service
public class InventoryWarningServiceImpl implements IInventoryWarningService 
{
    @Autowired
    private InventoryWarningMapper inventoryWarningMapper;

    /**
     * 查询库存预警记录
     * 
     * @param warningId 库存预警记录主键
     * @return 库存预警记录
     */
    @Override
    public InventoryWarning selectInventoryWarningByWarningId(Long warningId)
    {
        return inventoryWarningMapper.selectInventoryWarningByWarningId(warningId);
    }

    /**
     * 查询库存预警记录列表
     * 
     * @param inventoryWarning 库存预警记录
     * @return 库存预警记录
     */
    @Override
    public List<InventoryWarning> selectInventoryWarningList(InventoryWarning inventoryWarning)
    {
        return inventoryWarningMapper.selectInventoryWarningList(inventoryWarning);
    }

    /**
     * 新增库存预警记录
     * 
     * @param inventoryWarning 库存预警记录
     * @return 结果
     */
    @Override
    public int insertInventoryWarning(InventoryWarning inventoryWarning)
    {
        return inventoryWarningMapper.insertInventoryWarning(inventoryWarning);
    }

    /**
     * 修改库存预警记录
     * 
     * @param inventoryWarning 库存预警记录
     * @return 结果
     */
    @Override
    public int updateInventoryWarning(InventoryWarning inventoryWarning)
    {
        return inventoryWarningMapper.updateInventoryWarning(inventoryWarning);
    }

    /**
     * 批量删除库存预警记录
     * 
     * @param warningIds 需要删除的库存预警记录主键
     * @return 结果
     */
    @Override
    public int deleteInventoryWarningByWarningIds(String warningIds)
    {
        return inventoryWarningMapper.deleteInventoryWarningByWarningIds(Convert.toStrArray(warningIds));
    }

    /**
     * 删除库存预警记录信息
     * 
     * @param warningId 库存预警记录主键
     * @return 结果
     */
    @Override
    public int deleteInventoryWarningByWarningId(Long warningId)
    {
        return inventoryWarningMapper.deleteInventoryWarningByWarningId(warningId);
    }
}
